/**
 * @file TcpApp_server_misc.h
 * @brief Helper functions for TcpApp/TCP server
 * @Author: aple
 * @Date: 2025-9-27 9:20:10
 * @LastEditors: aple
 * @LastEditTime: 2025-9-27 18:37:50
 * @Verision: 1.0.0.0
 **/

#ifndef _TCP_APP_SERVER_MISC_H
#define _TCP_APP_SERVER_MISC_H

// Dependencies
#include "core/net.h"
#include "server/tcp_server_app_common.h"

// C++ guard
#ifdef __cplusplus
extern "C"
{
#endif

   // TcpApp/TCP server related functions
   void TcpAppServerTick(TcpAppServerContext *context);

   void TcpAppServerRegisterConnectionEvents(TcpAppClientConnection *connection,
                                             SocketEventDesc *eventDesc);

   void TcpAppServerProcessConnectionEvents(TcpAppClientConnection *connection);

   void TcpAppServerLock(TcpAppClientConnection *connection);
   void TcpAppServerUnlock(TcpAppClientConnection *connection);

// C++ guard
#ifdef __cplusplus
}
#endif

#endif
